using Avalonia.Media;

namespace AvaAI批量点评系统.Models;

/// <summary>
/// 能力评语项目，用于在预览界面显示
/// </summary>
public class AbilityItem
{
    /// <summary>
    /// 能力名称
    /// </summary>
    public string AbilityName { get; set; } = string.Empty;

    /// <summary>
    /// 评语内容
    /// </summary>
    public string Comment { get; set; } = string.Empty;

    /// <summary>
    /// 等级 (A+, A, A-, B+, B, B-, C+, C, C-)
    /// </summary>
    public string Grade { get; set; } = "A";

    /// <summary>
    /// 等级对应的颜色
    /// </summary>
    public Color GradeColor
    {
        get
        {
            return Grade switch
            {
                "A+" => Color.FromRgb(231, 76, 60),   // 红色 - 优秀
                "A" => Color.FromRgb(230, 126, 34),   // 橙色 - 良好
                "A-" => Color.FromRgb(241, 196, 15),  // 黄色 - 中等偏上
                "B+" => Color.FromRgb(46, 204, 113),  // 绿色 - 中等
                "B" => Color.FromRgb(52, 152, 219),   // 蓝色 - 中等偏下
                "B-" => Color.FromRgb(155, 89, 182),  // 紫色 - 较差
                "C+" => Color.FromRgb(149, 165, 166), // 灰色 - 差
                "C" => Color.FromRgb(127, 140, 141),  // 深灰色 - 很差
                "C-" => Color.FromRgb(52, 73, 94),    // 深蓝灰色 - 极差
                _ => Color.FromRgb(52, 152, 219)      // 默认蓝色
            };
        }
    }
}
